<%- include('../../common/header.html',{css:'common'}) %>
<style>
    .datepicker {
        z-index: 9999 !important;
    }

    .data-select {
        display: inline-block;
        width: auto;
    }

    td {
        font-size: 10px;
    }

    .select-batch {
        width: 30px;
        height: 20px !important;
        padding: 0px !important;
        line-height: 20px;
        display: block;
        float: right;
        position: absolute;
        top: 4px;
        right: 0;
        color: #28a3ef;
        cursor: pointer;
        z-index: 9;
        background: #FFF;
        border: 1px solid #cCc !important;
        border-radius: 1px !important;
    }

    .select-batch:hover {
        border: 1px solid #28a3ef !important;
    }

    .select-batch:visited {
        border: 1px solid #1a65ef !important;
    }
</style>
<script id="form-select" type="application/xhtml+xml">
    <table class="table table-none-padding table-bordered" style="margin-bottom: 0;">
        <tr>
            <th>操作</th>
            <th >产品</td>
            <th >批号</td>
            <th >库存</th>
            <th >品质规格</th>
            <th>仓库</th>
            <th>类型</th>
            <th >免费仓储期</th>
            <th >发货数量</th>
        </tr>
        <$
        purchase.map(function(item,index){
            console.log(item.id+':'+_id);
            if(item.id != _id){
        $>
        <tr>
            <td>
                <input type="checkbox" data-json="<$=JSON.stringify(item)$>"
                <$ if(selected[item.id]){ $>
                checked
                <$}$>
                />
            </td>
            <td><$=item.goodsName$></td>
            <td>
                <$=item.batchNum $>
            </td>
            <td>
                <$=item.numberReceive>0?floatTool.subtract(floatTool.subtract(item.numberReceive,item.numberSended),item.numberSending):(
                item.type==0?item.number:(item.number-item.numberSending-item.numberSended)
                ) $> 吨
            </td>
            <td><$=item.quality $></td>
            <td><$=item.storeName $></td>
            <td><$=item.type==0?'车号':(item.type==1?'转货权':'介绍信') $></td>
            <td><$=formatDate(item.storeTime) $></td>
            <td><input type="text" class="form-control border-none form-inline" value="0"/> 吨</td>
        </tr>
        <$ }})
        $>
    </table>
</script>

<script type="application/xhtml+xml" id="item">
    <$ list.map(function(item){ $>
        <tr data-id="<$=item.id $>">
            <td><$=item.billBatch $></td>
            <td><$=item.number$> 吨</td>
            <td><a data-id='<$=JSON.stringify(item) $>' href="javascript:void(0);" class="data-select-selected">更换批号</a></td>
        </tr>
     <$ })$>
</script>
<script type="application/xhtml+xml" id="summary">
    <table class="table table-detail" style="width: 100%;">
        <tr>
            <td class="td-label">发货单号：</td>
            <td class="td-label-value"><$=no $></td>
            <td class="td-label">发货数量：</td>
            <td class="td-label-value"><$=numberThisTime $></td>
            <td class="td-label">发货类型：</td>
            <td class="td-label-value"><$=type==0?'车号':(type=='1'?'转货权':'介绍信') $></td>
        </tr>
        <tr>
            <td class="td-label"><$=type==0?'车号':'转货公司' $></td>
            <td class="td-label-value"><$=carId $></td>
            <td class="td-label">客户名称：</td>
            <td class="td-label-value"><$=clienteleName $></td>
            <td class="td-label">统一信用代码：</td>
            <td class="td-label-value"><$=unitCode $></td>
       </tr>
        <tr>
            <td class="td-label">包装规格</td>
            <td class="td-label-value"><$=pack $></td>
            <td class="td-label">品质规格：</td>
            <td class="td-label-value"><$=quality $></td>
            <td class="td-label">质量标准：</td>
            <td class="td-label-value"><$=qualityRequire $></td>
        </tr>
        <tr>
            <td class="td-label"><$=type==0?'提单有效期':'免费仓储期' $></td>
            <td class="td-label-value"><$=formatDate(expireTime) $></td>
            <td class="td-label">产品名称：</td>
            <td class="td-label-value"><$=goodsName $></td>

            <td class="td-label">提货仓库：</td>
            <td class="td-label-value"><$=storeName $></td>
        </tr>
   </table>
</script>
<title>后台管理系统</title>
</head>
<body class="sub-body">
<%- include('../../common/top-nav.html') %>
<%- include('../../common/page-title.html',{navs:[
{label:'首页',url:'../../main.html'},
{label:'销售管理',url:'javascript:void(0)'},
{label:'销售发货',url:'./index.html'},
{label:'更换批号',url:'javascript:void(0)'},
]}) %>
<div class="content">
    <form action="" id="form-send">
        <div class="panel panel-default">
            <div class="panel-body">
                <p id="summary-title">发货单</p>
                <br/>
                <p>批号 <span class="pull-right total"></span></p>
                <table class="table table-bordered table-batch">
                    <thead>
                        <tr>
                            <th>批号</th>
                            <th>数量</th>
                            <th>操作</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                        </tr>
                    </tbody>
                </table>
                <a class="btn btn-default" href="./index.html">返回</a>
            </div>
        </div>
    </form>
</div>
</body>
<!-- build:js ../../scripts/store/express/send.js  -->
<script type="text/javascript" src="./send.js"></script>
<!-- endbuild -->

</html>